package com.guli.auth.controller;

import com.guli.auth.service.MessageService;
import com.guli.common.utils.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/*
 * @Author 罗
 * @date 2020/10/18 - 2:45 下午
 */
@RestController
@RequestMapping("/message")
public class MessageController {

    @Resource
    MessageService messageService;

    @GetMapping("/sendMessage/{phoneNumber}")
    public R sendMessage(@PathVariable("phoneNumber")String phoneNumber){

        messageService.sendMessageAndPutIntoRedis(phoneNumber);

        return R.ok();
    }

}
